<?php
	session_start();
	if ($_SESSION['logd'] != 1){
	    Header("Location:login.php");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Message Hub</title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>

<body>

   <!-- Begin Wrapper -->
   <div id="wrapper">
   
         <!-- Begin Header -->
         <div id="header">
			<?php
				include("include/header.html");
			?>	
		 </div>
		 <!-- End Header -->
		 
         <!-- Begin Faux Columns -->
		 <div id="faux">
		 
		       <!-- Begin Left Column -->
		       <div id="leftcolumn">
				<?php
					include("include/menu.php");
				?>
		       </div>
		       <!-- End Left Column -->
		 
		       <!-- Begin Right Column -->
		       <div id="rightcolumn">
			   <div class="clear"></div>
			<h2>Overfiew over all profiles on msghub</h2>
			<?php
				include('scripts/dbconnect.php');
				require_once('PersonProfile.php');

				$query			= "SELECT * FROM Person WHERE OwnAccount = '1' AND PeId NOT LIKE '".$_SESSION['PeId']."'";
				$exec			= $db->query($query);

				while($row = mysqli_fetch_array($exec)){
				    $person		= new PersonProfile($row['PeId'], $_SESSION['PeId']);
				    $person->fetchFriendYesNo();
				    $person->fetchShowButton();
				    $person->arrangeData();
				    echo $person->getDataDiv();
				    echo "<hr />";
				}
			?>
			   
		       </div>
		       <!-- End Right Column -->
			   
			   <div class="clear"></div>
			   
         </div>	   
         <!-- End Faux Columns --> 

         <!-- Begin Footer -->
         <div id="footer">
			<?php
				include("include/footer.html");
			?>		
         </div>
		 <!-- End Footer -->
		 
   </div>
   <!-- End Wrapper -->
</body>
</html>
